<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title></title>
	[#import "/admin/include/admin_pagination.ftl" as p/]
	[#include "/admin/include/admin_static.htm"]
<script type="text/javascript">
    layui.use(['form', 'layer','upload','layedit'], function () {

        var form = layui.form(), layer = layui.layer;

        //通过
        form.on('submit(OkMainForm)', function(data){
            data.field.status=1;
            if($.trim(data.field.remark) == ''){
                layer.alert("审核备注不能为空！");
                return false;
            }
            layer.confirm("您确定审核通过吗？",function(){
                var index = layer.load();
                ajax({
                    url : "${path}/admin/borrow/verify.aspx",
                    type : "post",
                    data:data.field,
                    datatype : "json",
                    success : function(result) {
                        layer.close(index);
                        if(result.type == "success"){
                            layer.msg(result.content,{time:500}, function(){
                                location.href='${path}/admin/borrow/borrowList.aspx?status=${borrow.status}';
                            });
                        }else{
                            layer.msg(result.content,{icon:2});
                        }
                    },
                    complete:function(){
                        layer.close(index);
                    }
                });
            });
            return false;
        });

		//不通过
		form.on('submit(NoMainForm)', function(data){
            data.field.status=0;
            if($.trim(data.field.remark) == ''){
                layer.alert("审核备注不能为空！");
                return false;
            }
            layer.confirm("您确定审核不通过吗？",function(){
                var index = layer.load();
                ajax({
                    url : "${path}/admin/borrow/verify.aspx",
                    type : "post",
                    data:data.field,
                    datatype : "json",
                    success : function(result) {
                        layer.close(index);
                        if(result.type == "success"){
                            layer.msg(result.content,{time:500}, function(){
                                location.href='${path}/admin/borrow/borrowList.aspx?status=${borrow.status}';
                            });
                        }else{
                            layer.msg(result.content,{icon:2});
                        }
                    },
                    complete:function(){
                        layer.close(index);
                    }
                });
            });
            return false;
        });
	});
</script>
</head>
<body>
	<div class="main_admin_content">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend>满标审核</legend>
        </fieldset>
		<form  class="layui-form"  >
			<input type="hidden" name="token" value="${p2p_get_token()}">
            <input type="hidden" name="borrowId" value="${borrow.id}"  />
            <div class="layui-form-item">
                <label class="layui-form-label">审核备注:</label>
                <div class="layui-input-block">
                    <textarea rows="10" cols="30"name="remark" id="remark" class="layui-textarea"></textarea>

                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
            <button lay-submit lay-filter="OkMainForm" class="layui-btn">通过</button>
            <button lay-submit lay-filter="NoMainForm" class="layui-btn  layui-btn-primary">不通过</button>
                </div>
            </div>
		</form>
	</div>

</body>
</html>